package com.k2091.washcar.mapper;

import com.k2091.washcar.entity.FormInline;
import com.k2091.washcar.entity.ServiceItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2021-06-01
 */
public interface ServiceItemMapper extends BaseMapper<ServiceItem> {

    @Select("select * from service_item")
    List<ServiceItem> selectAll();

    List<ServiceItem> selectService(FormInline formInline);

    @Delete("delete from service_item where id=#{id}")
    boolean deleteById(Long id);

    @Update("UPDATE service_item SET status = #{status}  WHERE id = #{id}")
    Boolean upStatus(@Param("id")Long id, @Param("status")int status);

    int upProject(ServiceItem serviceItem);

    void addService(ServiceItem serviceItem);

    @Select("select * from service_item where id=#{id}")
    ServiceItem selectServiceById(@Param("id") Long id);

}
